﻿package com.javaPattern.Composite;

public class Client {
	public static void main(String args[]) {
		//构造一个文件目录
		Root root1 = new Folder("c:\\");
		Root root2 = new Folder("d:\\");
		Root win = new Folder("windows");
		Root sys = new Folder("system");
		Root pro = new Folder("program");
		Root hw = new File("HelloWorld.java");

		root1.addFile(win);
		root1.addFile(sys);
		root1.addFile(pro);
		win.addFile(hw);
		
		root1.display();
		root2.display();

	}
}
